﻿namespace Pibby.Core.IO
{
	using System.IO;

	public class FileSystemDrive : IDrive
	{
		public FileSystemDrive(string name)
		{
			this.driveInfo = new DriveInfo(name);
		}

		public bool IsReady 
		{ 
			get 
			{ 
				return this.driveInfo.IsReady; 
			}
		}

		public string Name 
		{ 
			get 
			{ 
				return this.driveInfo.Name; 
			} 
		}

		public string VolumeLabel 
		{ 
			get 
			{ 
				return this.driveInfo.VolumeLabel; 
			} 
		}

		public DriveType DriveType
		{ 
			get 
			{ 
				return this.driveInfo.DriveType; 
			} 
		}

		public long AvailableFreeSpace 
		{ 
			get 
			{ 
				return this.driveInfo.AvailableFreeSpace; 
			} 
		}

		public long TotalSize 
		{ 
			get 
			{ 
				return this.driveInfo.TotalSize; 
			} 
		}

		private DriveInfo driveInfo;

		#region ToString

		public override string ToString()
		{
			return string.Format("{0} : {1}", this.Name, this.VolumeLabel);
		}

		#endregion
	}
}
